local sk__jinzhi = fk.CreateSkill {

  name = "sk__jinzhi",

  tags = {  },

}



sk__jinzhi:addEffect("viewas", {
  name = "sk__jinzhi",
  pattern = ".|.|.|.|.|basic,trick",
  prompt = "#sk__jinzhi",
  interaction = function(self,player)
    local all_names = Fk:getAllCardNames("bt")
    local names = player.getViewAsCardNames(player, sk__jinzhi.name, all_names, {}, player:getTableMark("sk__jinzhi-round"))
    if #names == 0 then return false end
    return UI.CardNameBox { choices = names, all_choices = all_names }
  end,
  card_filter = Util.FalseFunc,
  view_as = function(self, player,cards)
    if not self.interaction.data then return end
    local card = Fk:cloneCard(self.interaction.data)
    card:addSubcards(player:getCardIds("h"))
    card.skillName = sk__jinzhi.name
    return card
  end,
  before_use = function(self, player, use)
    local mark = player:getTableMark("sk__jinzhi-round")
    table.insert(mark, use.card.trueName)
    player.room:setPlayerMark(player, "sk__jinzhi-round", mark)
  end,
  after_use = function (self, player, use)
    if not player.dead then
      player:drawCards(player:usedSkillTimes(sk__jinzhi.name, Player.HistoryRound), sk__jinzhi.name)
    end
  end,
  enabled_at_play = function(self, player)
    return not player:isKongcheng() and player:usedSkillTimes(sk__jinzhi.name, Player.HistoryRound) < 4
  end,
  enabled_at_response = function(self, player, response)
    return not response and Fk.currentResponsePattern and Exppattern:Parse(Fk.currentResponsePattern):matchExp(self.pattern) and
      not player:isKongcheng() and player:usedSkillTimes(sk__jinzhi.name, Player.HistoryRound) < 4
  end,
})

return sk__jinzhi